#ifndef _Boolean_h
#define _Boolean_h

#include "CxxUtils.h"
#include "LangUtils.h"

class DoOpBoolean
{
	static bool canGreatOrLess(CRefPtr< _DoObject > obj1, CRefPtr< _DoObject > obj2) {
		if (obj1->type() == obj2->type()) {
			if (obj1->type() == _DoObject::eNumber) 
				return true;
			if (obj1->type() == _DoObject::eString) 
				return true;
			if (obj1->type() == _DoObject::eName) 
				return true;
		}
		return false;
	}
public: 
	class ds_eq : public _DoOperator
	{
	protected: 
		ds_eq(const ds_eq &);
		ds_eq& operator=(const ds_eq &);
	public: 
		ds_eq() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_ne : public _DoOperator
	{
	protected: 
		ds_ne(const ds_ne &);
		ds_ne& operator=(const ds_ne &);
	public: 
		ds_ne() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_ge : public _DoOperator
	{
	protected: 
		ds_ge(const ds_ge &);
		ds_ge& operator=(const ds_ge &);
	public: 
		ds_ge() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_gt : public _DoOperator
	{
	protected: 
		ds_gt(const ds_gt &);
		ds_gt& operator=(const ds_gt &);
	public: 
		ds_gt() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_le : public _DoOperator
	{
	protected: 
		ds_le(const ds_le &);
		ds_le& operator=(const ds_le &);
	public: 
		ds_le() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_lt : public _DoOperator
	{
	protected: 
		ds_lt(const ds_lt &);
		ds_lt& operator=(const ds_lt &);
	public: 
		ds_lt() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_and : public _DoOperator
	{
	protected: 
		ds_and(const ds_and &);
		ds_and& operator=(const ds_and &);
	public: 
		ds_and() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_not : public _DoOperator
	{
	protected: 
		ds_not(const ds_not &);
		ds_not& operator=(const ds_not &);
	public: 
		ds_not() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_or : public _DoOperator
	{
	protected: 
		ds_or(const ds_or &);
		ds_or& operator=(const ds_or &);
	public: 
		ds_or() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_xor : public _DoOperator
	{
	protected: 
		ds_xor(const ds_xor &);
		ds_xor& operator=(const ds_xor &);
	public: 
		ds_xor() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_true : public _DoOperator
	{
	protected: 
		ds_true(const ds_true &);
		ds_true& operator=(const ds_true &);
	public: 
		ds_true() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_false : public _DoOperator
	{
	protected: 
		ds_false(const ds_false &);
		ds_false& operator=(const ds_false &);
	public: 
		ds_false() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_bitshift : public _DoOperator
	{
	protected: 
		ds_bitshift(const ds_bitshift &);
		ds_bitshift& operator=(const ds_bitshift &);
	public: 
		ds_bitshift() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	static void push(_DoDictionaryMultimap& dict) {
		dict.put(CRefPtr< _DoObject >(new DoName("eq")), CRefPtr< _DoObject >(new ds_eq()));
		dict.put(CRefPtr< _DoObject >(new DoName("ne")), CRefPtr< _DoObject >(new ds_ne()));
		dict.put(CRefPtr< _DoObject >(new DoName("ge")), CRefPtr< _DoObject >(new ds_ge()));
		dict.put(CRefPtr< _DoObject >(new DoName("gt")), CRefPtr< _DoObject >(new ds_gt()));
		dict.put(CRefPtr< _DoObject >(new DoName("le")), CRefPtr< _DoObject >(new ds_le()));
		dict.put(CRefPtr< _DoObject >(new DoName("lt")), CRefPtr< _DoObject >(new ds_lt()));
		dict.put(CRefPtr< _DoObject >(new DoName("and")), CRefPtr< _DoObject >(new ds_and()));
		dict.put(CRefPtr< _DoObject >(new DoName("not")), CRefPtr< _DoObject >(new ds_not()));
		dict.put(CRefPtr< _DoObject >(new DoName("or")), CRefPtr< _DoObject >(new ds_or()));
		dict.put(CRefPtr< _DoObject >(new DoName("xor")), CRefPtr< _DoObject >(new ds_xor()));
		dict.put(CRefPtr< _DoObject >(new DoName("true")), CRefPtr< _DoObject >(new ds_true()));
		dict.put(CRefPtr< _DoObject >(new DoName("false")), CRefPtr< _DoObject >(new ds_false()));
		dict.put(CRefPtr< _DoObject >(new DoName("bitshift")), CRefPtr< _DoObject >(new ds_bitshift()));
	}
};

#endif
